package com.stormrage.edu.serv.exam.impl;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.exam.ExmRelateCountDao;
import com.stormrage.edu.serv.exam.ExmRelateCountServ;
import com.stormrage.entity.exam.ExmRelateCount;
import com.stormrage.entity.exam.req.ExmExamReq;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: ExmRelateExamServImpl.java
 * @Package com.stormrage.edu.serv.exam.impl
 * @Description: 试题关联分数，数量 Service
 * @author www.stormragetech.com
 * @date 2016年4月22日
 * @version V1.0
 */
@Service
public class ExmRelateCountServImpl implements ExmRelateCountServ {

	private static final Logger logger = LoggerFactory.getLogger(ExmRelateCountServImpl.class);

	@Autowired
	private ExmRelateCountDao exmRelateExamDao;

	@Override
	public ExmRelateCount queryByTermRelateType(final ExmExamReq arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 ExmRelateExamServ 】- 【 queryByTermRelateType 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("termId", arg0.getTermId());
		map.put("relateId", arg0.getRelateId());
		map.put("type", arg0.getRelateType());

		ExmRelateCount entity = exmRelateExamDao.queryByTermRelateType(map);

		logger.debug(" 【 Serv 】- 【 ExmRelateExamServ 】- 【 queryByTermRelateType 】-【 COMPLETED 】");
		return entity;

	}

}
